package auction.server;

import java.util.TimerTask;

import auction.domain.Auction;

public class AuctionTask extends TimerTask {
	
	private Auction auction;	
	
    public AuctionTask(Auction auction) {
		super();
		this.auction = auction;
	}

	public void run() {
        System.out.println("Time is up for auction: "+auction.getId());
        
        Server.endAuction(auction); //set ended true
        
        //TODO: Notificatins
        
        this.cancel(); //close TimerTask 
        
      }
	
}